﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AppToolKit.Core.Context.Spring;

namespace CenterDateAchieve.Forms
{
    public partial class FormBase : Form
    {
        public FormBase()
        {
            InitializeComponent();
        }
        [AutoWiring]
        public ContextAware ContextAwareHolder { get; set; }
        private void FormBase_Load(object sender, EventArgs e)
        {

        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            const int WM_KEYDOWN = 256;
            const int WM_SYSKEYDOWN = 260;
            if (msg.Msg == WM_KEYDOWN || msg.Msg == WM_SYSKEYDOWN)
            {
                if (keyData == Keys.Escape)
                {
                    if (this is MainForm)
                    {
                    }
                    else
                    {
                        this.Close();

                    }
                    return true;
                }
                else
                    return base.ProcessCmdKey(ref msg, keyData);
            }
            else
                return base.ProcessCmdKey(ref msg, keyData);
        }
    }
}
